<?php
	include("../../includes/config.php");
	$returnUser = array();
	$donen = array();
	if($_GET['sSearch'] != "") { 
		$sSeach = mysql_real_escape_string($_GET['sSearch']);
		$where = "WHERE id LIKE '%".$sSeach."%' OR user_email LIKE '%".$sSeach."%' OR user_nome LIKE '%".$sSeach."%' OR user_cognome LIKE '%".$sSeach."%'";
		$toplam = 100;
	} else {
		$where = false;
		$toplu = $db->sql("SELECT COUNT(user_id) AS toplam FROM e_user_temp");
		$toplam = $db->getir($toplu);
	}
	
	
	
	
	//echo $where;
	$userArray = $user->getWaitActivationMember(intval($_GET['iDisplayStart']),intval($_GET['iDisplayLength']),false,$where);
	
	$returnUser['sEcho'] = intval($_GET['sEcho']);
	$returnUser['iTotalRecords'] = $toplam['toplam'];
	$returnUser['iTotalDisplayRecords'] = $toplam['toplam'];
	//$returnUser['iTotalDisplayRecords'] = intval($_GET['iDisplayLength']);
   
	//$returnUser['aaData'] =  
	$x = 1;
	
	foreach($userArray as $key=>$val) {
	$val['user_numid'] = $val['id'];
		$returnUser['aaData'][] = array(
			$val['user_numid'],
			$val['user_id'],
			$val['user_nome']." ".$val['user_cognome'],
			$val['user_email'],
			//($val['user_attivato'] == '1') ? 'Aktif' : 'Pasif',
			($val['user_gender'] == 'M') ? 'Bay' : 'Bayan',
			//($val['user_avatarinfo'] == '') ? 'Yok' : 'Var',
			//($val['fb_userid'] == '') ? 'Yok' : 'Var',
			//$val['user_tckno'],
			$val['activation_date'],
			"<a href='#' onclick='activeMember(\"".$val['id']."\")'>Hemen Aktif Et</a>"
		);
	}
			
	 
	echo json_encode($returnUser);

?>
